<?PHP
	class ResultSet {
		var $cursor;
		var $data;     
		var $fields;
		var $types;
		var $totalCount;
		function ResultSet($dataObj){   
			$this->totalCount = 0;
			$this->setData($dataObj);
		}
		function getData($dataName){
			if(isset($this->data[$this->cursor]) && array_key_exists($dataName,$this->data[$this->cursor])){
				return $this->data[$this->cursor][$dataName];
			}else{
				return false;
			}
		}
		function beforeFirst(){
			$this->cursor = -1;
		}
		function moveCursor($crsrPos){
			$this->cursor = $crsrPos;
		}
		function next(){
			if($this->cursor < count($this->data)-1){
				$this->cursor++;
				return true;
			}else{
				return false;
			}
		}                
		function setFields($rowFields){
			$this->fields = $rowFields;
		}                              
		function getFields(){
			return $this->fields;
		}   
		function setDataTypes($rowTypes){
			$this->types = $rowTypes;
		}                              
		function getDataTypes(){
			return $this->types;
		}
		function isEmpty(){
			return ($this->data==NULL);
		}
		function setData($dataObj){
			$this->data = $dataObj;
		}
		function setTotal($total){
			$this->totalCount = $total;
		}
		function getTotal(){
			return $this->totalCount;
		}
		function getLength(){
			return count($this->data);
		}
	}
?>
